package com.example.basic.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

/**
 * <p>
 * 系统角色信息表
 * </p>
 *
 * @author wangkai
 * @since 2019-06-04
 */
@TableName("tbl_sys_role")
public class SysRole extends Model<SysRole> {

	private static final long serialVersionUID = 1L;

	@TableId(value = "ID", type = IdType.AUTO)
	private Integer id;

	/**
	 * 角色代码
	 */
	@TableField("CODE")
	private String code;

	/**
	 * 角色名称
	 */
	@TableField("NAME")
	private String name;

	/**
	 * 是否可用
	 */
	@TableField("START")
	private Integer start;

	/**
	 * 删除状态
	 */
	@TableField("DEL_FLAG")
	private Integer delFlag;

	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	@TableField("CREATE_DATE")
	private Date createDate;

	@TableField("CREATE_USER_ID")
	private Integer createUserId;

	@TableField(exist = false)
	private List<SysPermission> permissions;

	/**
	 * 描述
	 */
	@TableField("REMARK")
	private String remark;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getStart() {
		return start;
	}

	public void setStart(Integer start) {
		this.start = start;
	}

	public Integer getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(Integer delFlag) {
		this.delFlag = delFlag;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Integer getCreateUserId() {
		return createUserId;
	}

	public void setCreateUserId(Integer createUserId) {
		this.createUserId = createUserId;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	public List<SysPermission> getPermissions() {
		return permissions;
	}

	public void setPermissions(List<SysPermission> permissions) {
		this.permissions = permissions;
	}

	@Override
	public String toString() {
		return "SysRole [id=" + id + ", code=" + code + ", name=" + name + ", start=" + start + ", delFlag=" + delFlag
				+ ", createDate=" + createDate + ", createUserId=" + createUserId + ", permissions=" + permissions
				+ ", remark=" + remark + "]";
	}

}
